<?php
namespace app\admin\controller;
use think\Controller;
use sand\handle;
use app\admin\controller\Base;
/**
* 
*/
class Order extends Base
{
    public function index(){
    	$this->assign('orders',model("order")->paginate(10));
        return $this->fetch();
    }
    public function detail(){
    	$order_code=intval(input('param.order_code'));
    	if(!$order_code) $this->error("请求参数有误");
    	$order=model('order')->find($order_code)->getData();
    	$params = require_once CONF_PATH.'sand/config/params.php';
        $handleData=$params['QueryOrder'];
        
        $handleData['pt']['orderCode']=$order['order_code'];
        $handleData['pt']['productId']=$order['product_id'];
        $handleData['pt']['tranTime']=$order['tran_time'];
       
        $cert = require_once CONF_PATH.'sand/config/cert.php';
        $handle = new handle($cert);
        
       /* dump($collectionData);
        exit();*/
        $res=json_decode($handle->execute($handleData));
        dump($res);
    }
}

